<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>documentName</title>
    <link rel="stylesheet" href="" />

    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.20.0/jquery.validate.min.js"></script>
    <script src="./message_cn.js"></script>
    <script>
      $().ready(function () {
        $('#registerForm').validate()
      })
    </script>
  </head>
  <body>

<form id="registerForm" method="get" action="">
  <fieldset>
    <p>
      <label for="cusername">用户名</label>
      <input id="cusername" name="username" type="text" data-rule-required="true" data-rule-rangelength="[2,10]" data-msg-required="用户名不能为空" data-msg-rangelength="用户名长度必须是2到10个字符">
    </p>
    <p>
      <label for="cpassword">密码</label>
      <input id="cpassword" name="password" type="password" data-rule-required="true" data-rule-minlength="6" data-msg-required="密码不能为空" data-msg-minlength="至少设置6位密码">
    </p>
    <p>
      <label for="cconfirmpassword">确认密码</label>
      <input id="cconfirmpassword" name="confirmpassword" type="password" data-rule-equalTo="#cpassword" data-msg-equalTo="两次密码不一致">
    </p>
    <p>
      <label for="cemail">邮箱</label>
      <input id="cemail" name="email" data-rule-required="true" data-rule-email="true" data-msg-required="邮箱不能为空" data-msg-email="邮箱的格式不正确">
      </input>
    </p>
    <p>
      <label for="chasreferee">有推荐人请勾选</label>
      <input type="checkbox" id="chasreferee" name="hasreferee">
    </p>
    <p>
      <label for="creferee">推荐人</label>
      <input id="creferee" name="referee" data-rule-required="#chasreferee:checked" data-msg-required="推荐人不能为空">
      </input>
    </p>
    <p>
      <input type="submit" value="提交">
    </p>
  </fieldset>
  </body>
</html>
